package com.mca.framework.functinalInterface;


import org.junit.Test;

/**
 * @Author: zhoupeng
 * @createTime: 2025年07月14日 21:39:48
 * @version: 1.0
 * @Description:
 * @copyright:
 */
public class MyTest {

    public void demo(MyFunctionalInterface functionalInterface){

        functionalInterface.exec();
    }

    @Test
    public void exec(){

        //jdk8之前
        demo(new MyFunctionalInterface(){
            @Override
            public void exec() {
                System.out.println("jdk8 before");
            }
        });

        //jdk8 lambda
        demo(()-> System.out.println("jdk8 later"));

    }
}
